package edu.sctu.wangfuxin.day20150609.util;

import edu.sctu.wangfuxin.day20150609.appbean.PeopleAppbean;

/**
 * Created by user06 on 2015/6/9.
 */

/***
 *
 * 进站包裹处理类
 */
public class BaoGuoDeth {
    private PeopleAppbean peopleappbean;
    private String weijin;


    /**
     * 构造函数
     * @param peopleappbean
     * @param weijin 违禁品
     */
    public BaoGuoDeth(PeopleAppbean peopleappbean,String weijin){
        this.peopleappbean = peopleappbean;
        this.weijin = weijin;
    }

    /**
     * 检查包裹
     *
     * @return
     */
    public boolean chaBaoGuo(){
        boolean is_weijin = false;
        if(peopleappbean.isIs_baoguo()){
            if(weijin.contains(peopleappbean.getBaoguoname())){
                is_weijin = true;
            }
        }else{
            is_weijin = false;
        }
        return is_weijin;
    }


    /**
     * 检查水
     *
     * @return
     */
    public boolean chaWater(){
        boolean is_weijin = false;
        if(peopleappbean.isIs_water()){
            if(weijin.contains(peopleappbean.getWatername())){
                is_weijin = true;
            }
        }else{
            is_weijin = false;
        }

        return is_weijin;
    }
}
